package com.crm.service.impl.csd.customerManager;

import com.crm.dao.mapper.customMapper.csd.CustomerContactPersonListMapper;
import com.crm.model.vo.csd.customerManager.CustomerContactPersonVO;
import com.crm.model.vo.csd.customerManager.CustomerServiceWorkLogVO;
import com.crm.service.csd.customerManager.CustomerContactPersonListDbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wangpeng
 * @Date 2021/8/26 15:15
 */
@Service
public class CustomerContactPersonListDbServiceImpl implements CustomerContactPersonListDbService {

    @Autowired
    private CustomerContactPersonListMapper customerContactPersonListMapper;

    /**
     * 客户列表--查看--联系人管理列表
     * @param customerId --客户ID
     * @author wangpeng
     * @return
     */
    @Override
    public List<CustomerContactPersonVO> selectCustomerContactPersonList(String customerId, String sortOrder,List<Integer> auditStatuss,List<Integer> onTheJobSituations) {
        return customerContactPersonListMapper.selectCustomerContactPersonList(customerId,sortOrder,auditStatuss,onTheJobSituations);
    }

    /**
     * 客户列表--查看--联系人管理列表--审核记录
     * @author wangpeng
     * @param contactPersonId
     */
    @Override
    public List<CustomerServiceWorkLogVO> selectAuditWorkLog(String contactPersonId, String sortOrder) {
        return customerContactPersonListMapper.selectAuditWorkLog(contactPersonId,sortOrder);
    }

    /**
     * 客户列表--查看--联系人管理列表--审核--修改审核
     * @author wangpeng
     * @param contactPersonId   客户ID
     * @param contactName  联系人
     * @param contactInformation  联系方式
     * @param auditStatus  审核状态
     */
    @Override
    public Boolean updateCustomerContactPersonByCustomerId(String contactPersonId, String contactName, String contactInformation, Integer auditStatus) {
        return customerContactPersonListMapper.updateCustomerContactPersonByCustomerId(contactPersonId,contactName,contactInformation,auditStatus);
    }


    /**
     * 客户列表--查看--联系人管理列表--审核--回显审核状态
     * @author wangpeng
     * @param contactPersonId
     */
    @Override
    public CustomerContactPersonVO selectCustomerContactPersonBycontactPersonId(String contactPersonId) {
        return customerContactPersonListMapper.selectCustomerContactPersonBycontactPersonId(contactPersonId);
    }
}
